package com.spdd.mt.biz.exception;

import com.spdd.mt.biz.constant.ResponseCode;
import com.spdd.mt.common.base.BaseException;
import lombok.Getter;
import lombok.Setter;

/**
 * 业务异常类
 */
public class NotifyException extends BaseException {

    /** 错误码 */
    @Getter
    @Setter
    private ResponseCode responseCode;

    /** 是否发飞书告警 */
    @Getter
    @Setter
    private Boolean sendAlarm = false;

    /** 异常内容 */
    @Getter
    @Setter
    private String message;

    public NotifyException(Boolean sendAlarm) {
        super();
        this.sendAlarm = sendAlarm;
    }

    public NotifyException(ResponseCode errorCodeEnum) {
        super(errorCodeEnum.getDesc());
        this.responseCode = errorCodeEnum;
        this.message = errorCodeEnum.getDesc();
    }

    public NotifyException(ResponseCode errorCodeEnum, String message) {
        super(errorCodeEnum.getDesc());
        this.responseCode = errorCodeEnum;
        this.message = message;
    }

    public NotifyException(ResponseCode errorCodeEnum, Boolean sendAlarm) {
        super(errorCodeEnum.getDesc());
        this.responseCode = errorCodeEnum;
        this.message = errorCodeEnum.getDesc();
        this.sendAlarm = sendAlarm;
    }
}
